﻿using SaaS.Core.Authorization;
using SaaS.Tool.Services;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;

namespace SaaS.Tool
{
    class Program
    {
        static void Main(string[] args)
        {


            Stopwatch sw = new Stopwatch();
            sw.Start();
            for (int i = 0; i < 100_000; i++)
            {
                UserModel_1 user = new UserModel_1()
                {
                    UserID = i,
                    CreateAt = DateTime.Now,
                    Status = UserStatus.Delete,
                    IsDefault = true,
                    UserName = $"张三{i}"
                };

                HashEntry[] hash = user;
                UserModel_1 model_1 = hash;
            }
            sw.Stop();
            Console.WriteLine($"硬编码耗时：{sw.ElapsedMilliseconds}ms");
            sw.Reset();
            sw.Start();
            for (int i = 0; i < 100_000; i++)
            {
                UserModel_2 user = new UserModel_2()
                {
                    UserID = i,
                    CreateAt = DateTime.Now,
                    Status = UserStatus.Delete,
                    IsDefault = true,
                    UserName = $"张三{i}"
                };

                HashEntry[] hash = user;
                UserModel_2 model_2 = hash;
            }
            sw.Stop();
            Console.WriteLine($"反射耗时：{sw.ElapsedMilliseconds}ms");
        }
    }
}
